<?php
class Zend_View_Helper_ShowPageIndex {
    public function showPageIndex($view) {

    	$page = $view->Page;
    	$str='';
    	$str .= '</br><a href="'.$view->url(array('controller'=>'page', 'action'=>'add')).'"><input type="submit" name="add" value="Thêm"  /></a></br>';
        $str .= '<table width="960" >';
		$str .= '<tr>';
		$str .= '<th width="10" height="30"><input type="checkbox" id="paradigm_all"></th>';
    	$str .= '<th width="100">Id</th>';
    	$str .= '<th width="200">Tên trang</th>';
    	$str .= '<th width="200">Slug</th>';
    	$str .= '<th width="200">Mô tả</th>';
    	$str .= '<th width="200">Ngày tạo</th>';
    	$str .= '<th width="200">Ngôn ngữ</th>';
    	$str .= '<th width="200"></th>';
		$str .= '</tr>';

        
		foreach ($page as $page) {
        	$str .= '<tr>'; 	
        	$str .='<td width="10"><input type="checkbox" name="chk" value="Yes"></td>';
            $str .='<td height="20" width="100">'.$page->page_id.'</td>';
            $str .='<td height="17" width="200">'.$page->name.'</td>';
            $str .='<td height="17" width="200">'.$page->slug.'</td>';
            $str .='<td height="17" width="200">'.$page->description.'</td>';
            $str .='<td height="17" width="200">'.$page->created_date.'</td>';
            $str .='<td height="17" width="200">'.$page->language.'</td>';
            $str .=	'<td><a href="'.$view->url(array('controller'=>'page', 'action'=>'edit', 'page_id'=>$page->page_id)).'"><input type="submit" name="edit" value="Sửa" /></a> ';
            $str .= '<a href="'.$view->url(array('controller'=>'page', 'action'=>'delete','page_id'=>$page->page_id)).'"><input type="submit" name="delete" value="Xóa"/></a></td>';
            
//            $str .= '<a href="'.$view->url(array('module'=>'default', 'controller'=>'page','action'=>'detail','page_id'=>$page->page_id)).'"><input type="submit" name="add" value="Kích hoạt"  /></a></td>';
            $str .='</tr>';
        }
        
        $str .= '</table>';
        
        return $str; 

    }
}